package myProject.gwt.client.simpleTable;


import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

public class HeaderCell extends FocusPanel implements IHeaderCell {
	
	private int columnIndex;
	//private SimplePanel simplePanel = new SimplePanel();
	private int width;

	public HeaderCell(int columnIndex, String caption) {
		super();
		this.columnIndex = columnIndex;
		//initWidget(simplePanel);
		this.add(new Label(caption));
	}

	@Override
	public int getColumnIndex() {
		return columnIndex;
	}

	@Override
	public Widget getComponent() {
		return this;
	}

	@Override
	public int getWidth() {		
		return width;
		//return simplePanel.getOffsetWidth();
	}

	@Override
	public void setWidth(int width) {
		this.setWidth(width+"px");
		this.width = width;
	}

}
